Skip to content

Update overlay.js to display actual error message when works with webpack 5.0.0? #2760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Xrumet
Copy link
Contributor

@Xrumet Xrumet commented Oct 11, 2020

  • [x ] This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Motivation / Use-Case

As a user I have updated to Webpack 5.0.0.
Not sure if this fix should be addressed here or in webpack/webpack repo.
Trying to use webpack-dev-server 3.11.0 in order with webpack 5.0.0 and using "overlay" feature I see data format is changed and errors are not displayed in browser's overlay.
This change should avoid the issue and be backward compatible.

Breaking Changes

Additional Info

@jsf-clabot
Copy link

jsf-clabot commented Oct 11, 2020

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Oct 11, 2020

Codecov Report

Merging #2760 (3df55b7) into v4 (4ab1f21) will decrease coverage by 0.28%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v4    #2760      +/-   ##
==========================================
- Coverage   93.77%   93.48%   -0.29%     
==========================================
  Files          34       34              
  Lines        1333     1336       +3     
  Branches      381      382       +1     
==========================================
- Hits         1250     1249       -1     
- Misses         81       85       +4     
  Partials        2        2              
Impacted Files Coverage Δ
client-src/default/overlay.js 95.65% <66.66%> (-1.32%) ⬇️
lib/utils/updateCompiler.js 97.14% <0.00%> (-2.86%) ⬇️
lib/Server.js 96.36% <0.00%> (-0.43%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ab1f21...3df55b7. Read the comment docs.

@Xrumet Xrumet marked this pull request as draft October 11, 2020 15:16
added null check
@alexander-akait
Copy link
Member

Can you provide example the problem? Maybe screenshot(s)?

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 11, 2020

image

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 11, 2020

Some why "message" object format is changed when I switch from webpack v4.44.2 to v5.0.0.
Instead of string Array now it is Array of objects with only "message" property.

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 11, 2020

Hi, @evilebottnawi
I am new on Github and newb with all this Nodejs and related stuff.
I have no idea even how to run and pass all those tests/checks.
I do not know is this issue should be addressed in webpack-dev-server or in webpack or some webpack's dependency.
I hope the issue is pretty clear for you, and if you could assist/help with it - I will appreciate it...
Please let me know if you need some more information.

Thanks!

@phara0hcom
Copy link

@Xrumet Did you also updated webpack-cli? I had an issue with the dev-server and webpack 5 but I downgraded webpack-cli back to 3.3.12 and it was all fine.

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 12, 2020

@phara0hcom No, I am using Node API to start dev server, so I had removed webpack-cli at all.
Not sure, is it important, my dev-server configuration is in webpack config like that:
devServer:{
....
overlay: {
errors: true,
warnings: false
},
...
}

@phara0hcom
Copy link

@Xrumet Ok, could you try to install webpack-cli npm install -D webpack-cli
https://github.com/webpack/webpack-cli#about
If I read this then I think you need it.

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 12, 2020

@phara0hcom sure, I have already tried it right after your previous comment.
I have installed webpack-cli v3.3.12 and also run my project with CLI instead of API.
Behavior is the same. I see error overlay itself. But, because error "data" format is changed - "entities.encode" or "ansiHTML" checks input string for "length" property (expecting a string but object is passed) and returns empty string.

So, I see "Build failed." message but do not see errors/warnings list.

@Xrumet
Copy link
Contributor Author

Xrumet commented Oct 13, 2020

Hi @evilebottnawi
Could you help with this fix?
I have try to run npm install on my windows and it failed some why.
So, I cannot even try to write and check unit tests to pass code coverage policy.

Seems like that's it for me :(

@Xrumet Xrumet closed this Oct 13, 2020
@alexander-akait alexander-akait changed the base branch from master to v4 November 16, 2020 11:25
@alexander-akait
Copy link
Member

@Xrumet Hi, can you rebase?

@alexander-akait alexander-akait deleted the branch webpack:v4 November 27, 2020 15:05
@Xrumet Xrumet deleted the fix-for-new-overlay-error-message-format branch December 3, 2020 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants